#include "config.h"
#include <stdio.h>

#define SPEED_ADDR 0x4000

uint8_t config_load_speed(void)
{
  return FLASH_ReadByte(SPEED_ADDR);
}

void config_save_speed(uint8_t speed)
{
  FLASH_SetProgrammingTime(FLASH_PROGRAMTIME_STANDARD);
  FLASH_Unlock(FLASH_MEMTYPE_DATA);
  FLASH_ProgramByte(SPEED_ADDR, speed);
}
